package com.ruoyi.prt.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.prt.domain.PrtPrintLog;
import com.ruoyi.prt.domain.vo.PrtPrintLogVO;
import com.ruoyi.prt.mapper.PrtPrintLogMapper;
import com.ruoyi.prt.service.IPrtPrintLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 打印记录Service业务层处理
 *
 * @author xiaobo Yan
 * @date 2021-03-31
 */
@Service
public class PrtPrintLogServiceImpl implements IPrtPrintLogService
{
    @Autowired
    private PrtPrintLogMapper prtPrintLogMapper;

    /**
     * 查询打印记录
     *
     * @param printLogId 打印记录ID
     * @return 打印记录
     */
    @Override
    public PrtPrintLog selectPrtPrintLogById(String printLogId)
    {
        return prtPrintLogMapper.selectPrtPrintLogById(printLogId);
    }

    /**
     * 查询打印记录列表
     *
     * @param prtPrintLog 打印记录
     * @return 打印记录
     */
    @Override
    public List<PrtPrintLog> selectPrtPrintLogList(PrtPrintLog prtPrintLog)
    {
        return prtPrintLogMapper.selectPrtPrintLogList(prtPrintLog);
    }


    /**
     * 查询打印记录列表
     *
     * @param prtPrintLog 打印记录
     * @return 打印记录
     */
    @Override
    public PageInfo<PrtPrintLog> selectPrtPrintLogList(PrtPrintLogVO prtPrintLog)
    {
        PageHelper.startPage(prtPrintLog.getPageIndex(), prtPrintLog.getPageSize());
        List<PrtPrintLog> list = prtPrintLogMapper.selectPrtPrintLogByTime(prtPrintLog);
        return new PageInfo <>(list);
    }

    /**
     * 新增打印记录
     *
     * @param prtPrintLog 打印记录
     * @return 结果
     */
    @Override
    public int insertPrtPrintLog(PrtPrintLog prtPrintLog)
    {
        return prtPrintLogMapper.insertPrtPrintLog(prtPrintLog);
    }

    /**
     * 修改打印记录
     *
     * @param prtPrintLog 打印记录
     * @return 结果
     */
    @Override
    public int updatePrtPrintLog(PrtPrintLog prtPrintLog)
    {
        return prtPrintLogMapper.updatePrtPrintLog(prtPrintLog);
    }

    /**
     * 批量删除打印记录
     *
     * @param printLogIds 需要删除的打印记录ID
     * @return 结果
     */
    @Override
    public int deletePrtPrintLogByIds(String[] printLogIds)
    {
        return prtPrintLogMapper.deletePrtPrintLogByIds(printLogIds);
    }

    /**
     * 删除打印记录信息
     *
     * @param printLogId 打印记录ID
     * @return 结果
     */
    @Override
    public int deletePrtPrintLogById(String printLogId)
    {
        return prtPrintLogMapper.deletePrtPrintLogById(printLogId);
    }
}
